#include "DataStructure/data_structure/list.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#include <unistd.h>

int main()
{
    PList ls = list_Creat(sizeof(int));
    for (int i = 0; i < 50000000; i++)
        list_push_back(ls, &i);

    list_pop_back(ls);
    list_pop_front(ls);

    PList_Node p1 = list_begin(ls), p2;

    clock_t now = clock();
    printf("start %f seconds\n\n", (double)(now) / CLOCKS_PER_SEC);
    list_reverse(ls);
    printf("%f seconds\n", (double)(clock() - now) / CLOCKS_PER_SEC);

    p1 = list_begin(ls);
    p2 = list_end(ls);

    printf("%d\t", data_int(p1->data));
    printf("%d\t", data_int(p2->data));
    puts("OK");
}